import {
  WorkflowProcessFindById,
  SystemZeroCodeFindColumnJsonByDataFromName,
  SystemZeroCodeQuery,
  SystemDataBaseTableColumn,
  SystemZeroCodeSaveJson,
  SystemZeroCodePublicJson,
  SystemZeroCodeFindById,
} from "@/services/api";
import { request, METHOD } from "@/utils/request";

/**
 * 保存
 */
export async function printSave(form) {
  return request(SystemZeroCodeSaveJson, METHOD.POST, form);
}
/**
 * 发布
 */
export async function printPublic(form) {
  return request(SystemZeroCodePublicJson, METHOD.POST, form);
}
/**
 * 列
 */
export async function column(param) {
  return request(SystemDataBaseTableColumn, METHOD.POST, param);
}
/**
 * 根据Id获取
 */
export async function findById(id) {
  return request(SystemZeroCodeFindById + "/" + id, METHOD.GET, {});
}

/**
 * 列表
 */
export async function query(param) {
  return request(SystemZeroCodeQuery, METHOD.POST, param);
}

/**
 * 根据表名获取配置
 */
export async function findDataFromName(param) {
  return request(
    SystemZeroCodeFindColumnJsonByDataFromName,
    METHOD.POST,
    param
  );
}
/**
 * 根据Id获取
 */
export function findWorkflowById(id) {
  return request(WorkflowProcessFindById + "/" + id, METHOD.GET, {});
}
export default {
  printSave,
  printPublic,
  findById,
  column,
  query,
  findDataFromName,
  findWorkflowById,
};
